import psutil
import keyboard
import pyautogui


# "QQSpeedLauncher.exe"

def judgeprocess(processname):
    """
        判断进程是否存在，存在返回真，否则返回假
        :param 参数1: 进程名称
        :return: 存在返回真，否则返回假
        """
    pl = psutil.pids()
    for pid in pl:
        if psutil.Procewss(pid).name() == processname:
            return True
    else:
        return False


def autow():
    #if (judgeprocess("GameApp.exe") == True):
    print("已监听")
    pyautogui.press('w')
    


def main():
    # 监听方向上键
    keyboard.add_hotkey('up', autow)
    input("正在运行中")


if __name__ == "__main__":
    main()

